<template>
  <div>
    <el-button type="text" @click="dialogFormVisible = true">打开嵌套表单的 Dialog</el-button>

    <el-dialog title="新增目录" :visible.sync="dialogFormVisible">
      <el-form :model="category">
        <el-form-item label="目录名称" :label-width="formLabelWidth">
          <el-input v-model="category.name" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="addCategory">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        dialogFormVisible: false,
        category: {
          name: ''
        },
        formLabelWidth: '120px',
      };
    },
    methods: {
      addCategory() {
        console.log("添加三级分类：", this.category);
      }
    }
  }
</script>
<style></style>
